﻿<%@ control language="C#" autoeventwireup="true" inherits="UserControls_QLNguoiDung, App_Web_nauw1oz5" %>


<style type="text/css">
    .auto-style1
    {
        height: 23px;
    }
    .auto-style2
    {
        width: 150px;
        text-align: center;
    }
    .auto-style3
    {
        height: 23px;
        width: 150px;
        font-weight: normal;
        background-color: #FFFFFF;
        text-align: left;
        color: #003366;
    }
    .auto-style4
    {
        color: #003366;
    }
    .auto-style6
    {
        font-weight: normal;
    }
    .auto-style8
    {
        background-color: #FFFFFF;
    }
    .auto-style10
    {
        width: 150px;
        font-weight: normal;
        color: #003366;
        background-color: #FFFFFF;
    }
    .auto-style11
    {
        width: 150px;
        color: #003366;
    }
    .auto-style12
    {
        color: #003366;
        background-color: #FFFFFF;
    }
    .auto-style13
    {
        width: 150px;
        text-align: left;
        color: #003366;
    }
    .auto-style14
    {
        height: 23px;
        color: #003366;
    }
</style>


<form id="form2" runat="server">

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="MaND" DataSourceID="SqlDataSource1" EnableModelValidation="True">
        <Columns>
            <asp:BoundField DataField="MaND" HeaderText="MaND" ReadOnly="True" SortExpression="MaND" />
            <asp:BoundField DataField="TenND" HeaderText="TenND" SortExpression="TenND" />
            <asp:BoundField DataField="MaKH" HeaderText="MaKH" SortExpression="MaKH" />
            <asp:BoundField DataField="SLTNCon" HeaderText="SLTNCon" SortExpression="SLTNCon" />
            <asp:BoundField DataField="QuyenHan" HeaderText="QuyenHan" SortExpression="QuyenHan" />
        </Columns>
    </asp:GridView>
    <br />
    <br />
&nbsp;<asp:FormView ID="FormView1" runat="server" AllowPaging="True" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaND" DataSourceID="SqlDataSource1" EnableModelValidation="True" GridLines="Both" Height="196px" style="margin-bottom: 0px; background-color: #FFFFFF" Width="359px">
        <EditItemTemplate>
            <table style="width:100%;">
                <tr>
                    <td class="auto-style11"><span class="auto-style12">Mã ND:</span></td>
                    <td>
                        <span class="auto-style4">
                        <asp:Label ID="MaNDLabel1" runat="server" CssClass="auto-style8" Text='<%# Eval("MaND") %>' />
                        </span>
                    </td>
                    </span></span></span>
                </tr>
                <tr>
                    <td class="auto-style10">Tên ND:</td>
                    <td>
                        <asp:TextBox ID="TenNDTextBox" runat="server" Text='<%# Bind("TenND") %>' CssClass="auto-style4" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style10">Số lượng tin nhắn:</td>
                    <td>
                        <asp:TextBox ID="SLTNConTextBox" runat="server" Text='<%# Bind("SLTNCon") %>' CssClass="auto-style4" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style10">Mã khoa:</td>
                    <td>
                        <asp:TextBox ID="MaKHTextBox" runat="server" Text='<%# Bind("MaKH") %>' CssClass="auto-style4" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style10">Quyền hạn:</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="QuyenHanTextBox" runat="server" Text='<%# Bind("QuyenHan") %>' CssClass="auto-style4" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style2"><span class="auto-style6"></span></td>
                    <td class="auto-style8">&nbsp;</td>
                </tr>
                <tr>
                    <td class="auto-style2">
                        <asp:Button ID="Button2" runat="server" CommandName="Update" Text="Cập nhật" />
                    </td>
                    <td style="text-align: center">
                        <asp:Button ID="Button3" runat="server" CommandName="Cancel" Text="Hủy" />
                    </td>
                </tr>
            </table>
            <br class="auto-style8" />
            <span class="auto-style8">&nbsp; </span>
        </EditItemTemplate>
        <EditRowStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="#CCFF99" />
        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
        <InsertItemTemplate>
            MaND:
            <asp:TextBox ID="MaNDTextBox" runat="server" Text='<%# Bind("MaND") %>' />
            <br />
            TenND:
            <asp:TextBox ID="TenNDTextBox" runat="server" Text='<%# Bind("TenND") %>' />
            <br />
            MaKH:
            <asp:TextBox ID="MaKHTextBox" runat="server" Text='<%# Bind("MaKH") %>' />
            <br />
            SLTNCon:
            <asp:TextBox ID="SLTNConTextBox" runat="server" Text='<%# Bind("SLTNCon") %>' />
            <br />
            QuyenHan:
            <asp:TextBox ID="QuyenHanTextBox" runat="server" Text='<%# Bind("QuyenHan") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            <table style="width:100%;">
                <tr>
                    <td class="auto-style13"><span>Mã ND:</span></td>
                    <td>
                        <asp:Label ID="MaNDLabel" runat="server" Text='<%# Bind("MaND") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style13"><span>Tên ND:</span></td>
                    </span></span></span></span></span></span></span></span></span>
                    <td>
                        </span class="auto-style4">
                        <asp:Label ID="TenNDLabel" runat="server" Text='<%# Bind("TenND") %>' />
                    </td>
                    <td></span></td>
                </tr>
                <tr>
                    <td class="auto-style13"><span>Số lượng tin nhắn:</span></td>
                    </span></span></span></span></span></span></span></span></span>
                    <td>
                        </span class="auto-style4">
                        <asp:Label ID="SLTNConLabel" runat="server" Text='<%# Bind("SLTNCon") %>' />
                    </td>
                    <td></span></td>
                </tr>
                <tr>
                    <td class="auto-style13"><span>Mã khoa:</span></td>
                    </span></span></span></span></span></span></span></span></span>
                    <td>
                        </span class="auto-style4">
                        <asp:Label ID="MaKHLabel" runat="server" Text='<%# Bind("MaKH") %>' />
                    </td>
                    <td></span></td>
                </tr>
                <tr>
                    <td class="auto-style3"><span>Quyền hạn:</span></td>
                    </span></span></span></span></span></span></span></span></span>
                    <td class="auto-style14">
                        <asp:Label ID="QuyenHanLabel" runat="server" Text='<%# Bind("QuyenHan") %>' />
                        </span></td>
                    <td class="auto-style1"></td>
                </tr>
                <tr>
                    <td class="auto-style2"></td>
                    <td></span class="auto-style4"></td>
                    <td></span></td>
                </tr>
                <tr>
                    <td class="auto-style2">
                        <asp:Button ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Sửa" />
                    </td>
                    <td>
                        <asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete" Text="Xóa" />
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <br />
            &nbsp;
        </ItemTemplate>
        <PagerSettings Mode="NumericFirstLast" />
        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Center" Font-Bold="True" Font-Size="Larger" />
        <RowStyle BackColor="White" ForeColor="#003399" />
    </asp:FormView>

</form>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:SMSWebConnectionString %>" DeleteCommand="DELETE FROM [NguoiDung] WHERE [MaND] = @original_MaND AND [TenND] = @original_TenND AND (([MaKH] = @original_MaKH) OR ([MaKH] IS NULL AND @original_MaKH IS NULL)) AND (([SLTNCon] = @original_SLTNCon) OR ([SLTNCon] IS NULL AND @original_SLTNCon IS NULL)) AND (([QuyenHan] = @original_QuyenHan) OR ([QuyenHan] IS NULL AND @original_QuyenHan IS NULL))" InsertCommand="INSERT INTO [NguoiDung] ([MaND], [TenND], [MaKH], [SLTNCon], [QuyenHan]) VALUES (@MaND, @TenND, @MaKH, @SLTNCon, @QuyenHan)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [MaND], [TenND], [MaKH], [SLTNCon], [QuyenHan] FROM [NguoiDung]" UpdateCommand="UPDATE [NguoiDung] SET [TenND] = @TenND, [MaKH] = @MaKH, [SLTNCon] = @SLTNCon, [QuyenHan] = @QuyenHan WHERE [MaND] = @original_MaND AND [TenND] = @original_TenND AND (([MaKH] = @original_MaKH) OR ([MaKH] IS NULL AND @original_MaKH IS NULL)) AND (([SLTNCon] = @original_SLTNCon) OR ([SLTNCon] IS NULL AND @original_SLTNCon IS NULL)) AND (([QuyenHan] = @original_QuyenHan) OR ([QuyenHan] IS NULL AND @original_QuyenHan IS NULL))">
    <DeleteParameters>
        <asp:Parameter Name="original_MaND" Type="String" />
        <asp:Parameter Name="original_TenND" Type="String" />
        <asp:Parameter Name="original_MaKH" Type="String" />
        <asp:Parameter Name="original_SLTNCon" Type="Double" />
        <asp:Parameter Name="original_QuyenHan" Type="String" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="MaND" Type="String" />
        <asp:Parameter Name="TenND" Type="String" />
        <asp:Parameter Name="MaKH" Type="String" />
        <asp:Parameter Name="SLTNCon" Type="Double" />
        <asp:Parameter Name="QuyenHan" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="TenND" Type="String" />
        <asp:Parameter Name="MaKH" Type="String" />
        <asp:Parameter Name="SLTNCon" Type="Double" />
        <asp:Parameter Name="QuyenHan" Type="String" />
        <asp:Parameter Name="original_MaND" Type="String" />
        <asp:Parameter Name="original_TenND" Type="String" />
        <asp:Parameter Name="original_MaKH" Type="String" />
        <asp:Parameter Name="original_SLTNCon" Type="Double" />
        <asp:Parameter Name="original_QuyenHan" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>

